public class Problem12 {
	public static void main(String[] args) {
		int term = 0;
		int j = 1;
		while (true) {
			term += j++;

			if (count_factor(term) > 500) {
				//break;
				System.out.println(term+"");
				return;
			}
		}

/*
		int i = (j >> 1);

		//binary search
		while (i <= j) {
			int mid = i + (j-i)/2;
			term = mid*(mid+1)/2;

			if (count_factor(term) > 500) {
				j = mid - 1;
			} else if (count_factor(term) < 500) {
				i = mid + 1;
			}
			else
				break;
		}

		if (i > j) {
			System.out.println("" + i*(i+1)/2);
		} else {
			int mid = i+ (j-i)/2;
			i = mid + 1;
			while (true) {
				term = i*(i+1)/2;
				if (count_factor(term) > 500)
					break;
				i++;
			}

			System.out.println("" + i*(i+1)/2);
		}

*/
	}

	private static int count_factor(int x) {
		int count = 0;
		for (int i = 1; i <= Math.sqrt(x); ++i) {
			if (x % i == 0)
				count+=2;
		}

		if (Math.sqrt(x)*Math.sqrt(x) == x)
			count--;

		return ++count;
	}
}
